﻿<%@ Page Language="C#" MasterPageFile="~/Org/MasterPage.master" EnableEventValidation="false" AutoEventWireup="true" CodeFile="frmO_AppCompBasicInput.aspx.cs" Inherits="Org_frmO_AppCompBasicInput" Title="組合員企業新規追加登録" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
組合員企業新規追加登録</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <link href="../Style/OrStyle1.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery.min.js" type="text/javascript" language="javascript"></script>
<script src="../js/Validation.js"type="text/javascript" language="javascript"></script>

    <script src="../js/jquery.blockUI.js" type="text/javascript"></script>
        <script type="text/javascript" language="javascript">
            var submit = true;
       
            function checkddl(ctrl, args) {
                if ($("#<%= ddl_組合担当者2.ClientID %>").val() != "-1") {
                    if ($("#<%= ddl_組合担当者1.ClientID  %>").val() == $("#<%= ddl_組合担当者2.ClientID  %>").val()) {
                        args.IsValid = false;
                    }
                }
            }

            
            $(document).ready(function() {
                regist();
            });
            
        function regist() {

            disableControlOnLoadUpdatePanel("<%= up.ClientID %>", "<%= ddl_組合名.ClientID %>");
            
            $("#<%= hd_BrowserVer.ClientID %>").val((jQuery.browser).msie);
            if (document.getElementById("<%= ddl_組合名.ClientID %>") != null) {
                registerEnterEvent("enter", "<%= btn確認.ClientID %>", 7);
            } else {
                registerEnterEvent("enter", "<%= btn確認.ClientID %>", 6);
            }
            registerControlToValidation("validation");

            
        }

        function checddl(ctrl, args) {
            ValidatorEnable2(document.getElementById("<%= vld_ddl_組合担当者2.ClientID %>"), true);
            if ($("#<%= ddl_組合担当者1.ClientID %>").val() == "-1" && $("#<%= ddl_組合名.ClientID %>").val() != "-1") {
                args.IsValid = false;
            }
            else {
                
                args.IsValid = true;
            }
        }
        function checkExist(oSrc, args) {
            if (typeof($("#<%= ddl_組合名.ClientID %>").val()) == 'undefined') {
                if ($("#<%= hdf_企業名.ClientID %>").val() != "" && $("#<%= hdf_企業名.ClientID %>").val() == $("#<%= txt_組合員企業名.ClientID %>").val() &&
                "<%= vld_checkExist.IsValid %>" == "False") {
                    args.IsValid = false;
                }
            } else {
                if ($("#<%= hdf_企業名.ClientID %>").val() != "" && $("#<%= hdf_企業名.ClientID %>").val() == $("#<%= txt_組合員企業名.ClientID %>").val() &&
                "<%= vld_checkExist.IsValid %>" == "False" && $("#<%= hdf_組合名.ClientID %>").val() == $("#<%= ddl_組合名.ClientID %>").val()) {
                    args.IsValid = false;
            }
            }
        }
            
        </script>
<div class="maindiv1">

<style>.detail-admin-row {padding-left:70px;} .Header3{padding-left:278px;padding-top:50px;} body,input,span,div { font-family: MS UI Gothic}.chk{ margin-left:-2px}</style>
    <asp:HiddenField ID="hd_BrowserVer" runat="server" />
            <span class="detail-admin-label">
    </span>
        <div class="Header1">
            <span>＊: 必須入力項目</span>
        </div>
        <div style="height:30px">&nbsp;</div>
<%--        <div class="detail-admin-row" style="margin-bottom:10px">
            <span class="detail-admin-label" style=" margin-bottom:0px">企業コード：</span>
            <div style="padding-top:3px;">            <asp:Label ID="lbl_企業コード" runat="server" Width="170px" Height="14px" MaxLength="25" Style="ime-mode: disabled"></asp:Label>
            </div>
        </div>--%>
        <asp:UpdatePanel ID="up" runat="server">
    <Triggers><asp:AsyncPostBackTrigger ControlID="ddl_組合名" /></Triggers>
    <ContentTemplate>
        
         <div class="detail-admin-row">
            <span class="detail-admin-label">企業グループコード ：</span>
            <asp:TextBox TabIndex="1" ID="txt_企業グループコード" CssClass="enter textbox width2" runat="server" onkeypress="return NotInputSpecialKeys(this, event);" onpaste="return false;" autocomplete="off" Font-Names="MS UI Gothic" MaxLength="25"
                 ValidationGroup="detailForm" Style="ime-mode: disabled"></asp:TextBox>
            
             <asp:CustomValidator ID="vld_txt_企業グループコード_format" runat="server" 
                 ControlToValidate="txt_企業グループコード" ErrorMessage=""  Display="None"
                 ClientValidationFunction="check1Byte" ></asp:CustomValidator>
                  <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender5"
                    TargetControlID="vld_txt_企業グループコード_format" 
                    HighlightCssClass="invalid" Width="255px"
                    CssClass="CustomValidatorCalloutStyle" 
                 WarningIconImageUrl="../Images/warning.png" >
             </ajaxToolkit:ValidatorCalloutExtender>
            <asp:CustomValidator ID="vld_txt_企業グループコード_format1" runat="server" 
                 ControlToValidate="txt_企業グループコード" ErrorMessage=""  Display="None"
                 ClientValidationFunction="CheckNotInputSpecialKeys" ></asp:CustomValidator>
                  <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2"
                    TargetControlID="vld_txt_企業グループコード_format1" 
                    HighlightCssClass="invalid1"
                    CssClass="CustomValidatorCalloutStyle"  Width="240px"
                 WarningIconImageUrl="../Images/warning.png" >
             </ajaxToolkit:ValidatorCalloutExtender>
             
        </div>        
<%--         <div class="detail-admin-row fix_detail-admin-row" style="display:none">
            <span class="detail-admin-label">郵便番号 :</span>
            <div style="padding-top:2px;"> <asp:TextBox TabIndex="3" ID="txt_郵便番号" Style="ime-mode: disabled" runat="server" ValidationGroup="detailForm" Width="171px" Height="14px"></asp:TextBox>&nbsp;
             <span class="required-field"></span></div>
             <ajaxToolkit:MaskedEditExtender runat="server" ID="mask" Mask="999-9999" MaskType="Number" ClearMaskOnLostFocus="false" TargetControlID="txt_郵便番号"></ajaxToolkit:MaskedEditExtender>
            <span class="required-field"> (*)</span>
        </div>--%>
        <div class="detail-admin-row">
        <asp:HiddenField ID="hdf_企業名" runat="server" />
        <asp:HiddenField ID="hdf_組合名" runat="server" />
            <span class="detail-admin-label">企業名 ：</span>
             <asp:TextBox TabIndex="2" ID="txt_組合員企業名" CssClass="enter validation textbox width3"  runat="server" Style="ime-mode: on" Font-Names="MS UI Gothic"
                ValidationGroup="detailForm" MaxLength="250"></asp:TextBox>
                <span class="required-field"> *</span>
            <asp:RequiredFieldValidator ID="vld_txt_組合員企業名" runat="server" ErrorMessage="" 
                ControlToValidate="txt_組合員企業名" Display="None" EnableClientScript="true"></asp:RequiredFieldValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender11"
                    TargetControlID="vld_txt_組合員企業名" 
                    HighlightCssClass="invalid" Width="255px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
           <asp:CustomValidator ID="vld_checkExist" runat="server" 
                 ControlToValidate="txt_組合員企業名" Display="None" ErrorMessage="CustomValidator" 
                 onservervalidate="checkExist" ClientValidationFunction="checkExist"></asp:CustomValidator>
                 <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender4"
                    TargetControlID="vld_checkExist" 
                    HighlightCssClass="invalid2" Width="255px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
        </div>
    
    
        <div class="detail-admin-row">
            <span class="detail-admin-label">組合名 ：</span>
                
                <asp:DropDownList TabIndex="3" ID="ddl_組合名" CssClass="enter validation dropdownlist width2" runat="server" ValidationGroup="detailForm" Font-Names="MS UI Gothic" AutoPostBack="True"
                    onselectedindexchanged="ddl_組合名_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:RequiredFieldValidator Display="None" ID="rqf_ddl_組合名" ControlToValidate="ddl_組合名" InitialValue="-1" runat="server" ></asp:RequiredFieldValidator>
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender7"
                    TargetControlID="rqf_ddl_組合名" 
                    HighlightCssClass="invalid2" Width="255px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                <asp:Label ID="lbl_組合名" runat="server"></asp:Label>
<%--               <ajaxToolkit:CascadingDropDown ID="ajaxddl_組合名" runat="server" TargetControlID="ddl_組合名"
                Category="Level1" SelectedValue="-1" PromptText="選択してください" PromptValue="-1" EmptyValue="-1" ServiceMethod="GetLevel1Data" LoadingText="ロード" EmptyText="選択してください">
            </ajaxToolkit:CascadingDropDown> --%>
        </div>
        
        <div class="detail-admin-row">
            <span class="detail-admin-label">組合担当者1 ：</span>
            <asp:DropDownList TabIndex="4" ID="ddl_組合担当者1" CssClass="enter validation dropdownlist width2" runat="server" ValidationGroup="detailForm" Font-Names="MS UI Gothic" ></asp:DropDownList>&nbsp; <span class="required-field">*</span>
                <asp:CustomValidator ID="vld_ddl_組合担当者1" runat="server" 
            ErrorMessage="" ClientValidationFunction="checddl" 
            Display="None" ControlToValidate="ddl_組合担当者1"></asp:CustomValidator>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender34" runat="server" 
                        TargetControlID="vld_ddl_組合担当者1" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                        WarningIconImageUrl="../Images/warning.png" Width="255px">
                    </ajaxToolkit:ValidatorCalloutExtender>
<%--                    <ajaxToolkit:CascadingDropDown ID="ajaxddl_組合担当者1" runat="server" ParentControlID="ddl_組合名" LoadingText="ロード" EmptyText="選択してください" 
                TargetControlID="ddl_組合担当者1" PromptText="選択してください" PromptValue="-1" EmptyValue="-1" SelectedValue="-1"
                Category="Level2" ServiceMethod="GetLevel2Data"></ajaxToolkit:CascadingDropDown>
--%>        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">組合担当者2 ：</span>
            <asp:DropDownList TabIndex="5" ID="ddl_組合担当者2" CssClass="validation enter dropdownlist width2" runat="server" ValidationGroup="detailForm" Font-Names="MS UI Gothic"></asp:DropDownList>
            <span class="required-field"> </span>
            <asp:CustomValidator ID="vld_ddl_組合担当者2" runat="server" ErrorMessage="" 
                Display="None" ControlToValidate="ddl_組合担当者2" 
                ClientValidationFunction="checkddl"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server"
                        TargetControlID="vld_ddl_組合担当者2" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                        WarningIconImageUrl="../Images/warning.png" Width="230px">
                    </ajaxToolkit:ValidatorCalloutExtender>
<%--                    <ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" ParentControlID="ddl_組合名" LoadingText="ロード" EmptyText="選択してください" 
                TargetControlID="ddl_組合担当者2" PromptText="選択してください" PromptValue="-1" EmptyValue="-1" SelectedValue="-1"
                Category="Level2" ServiceMethod="GetLevel2Data_2"></ajaxToolkit:CascadingDropDown>
--%>        </div>
        
        
        <div class="detail-admin-row">
            <span class="detail-admin-label">JITCO賛助会員番号 ：</span>
            <asp:TextBox ID="txt_JITCO賛助会員番号" CssClass="enter validation textbox width3" runat="server"  TabIndex="7" Style="ime-mode: disabled" onkeypress="return NotInputSpecialKeys(this, event);"
                ValidationGroup="detailForm" MaxLength="25" Font-Names="MS UI Gothic" ></asp:TextBox>
                <asp:CustomValidator ID="vld_txt_JITCO賛助会員番号_format" runat="server" 
                 ControlToValidate="txt_JITCO賛助会員番号" ErrorMessage=""  Display="None" 
                 ClientValidationFunction="check1Byte" ></asp:CustomValidator>
                  <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender6"
                    TargetControlID="vld_txt_JITCO賛助会員番号_format" 
                    HighlightCssClass="invalid" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                    <asp:CustomValidator ID="vld_txt_JITCO賛助会員番号_format1" runat="server" 
                 ControlToValidate="txt_JITCO賛助会員番号" ErrorMessage=""  Display="None" 
                 ClientValidationFunction="CheckNotInputSpecialKeys"  ></asp:CustomValidator>
                  <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3"
                    TargetControlID="vld_txt_JITCO賛助会員番号_format1" 
                    HighlightCssClass="invalid" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
            <span class="required-field"> </span>
        </div>
        <div class="detail-admin-row fix_detail-admin-row">
        <span class="detail-admin-label">&nbsp;</span>
            <asp:CheckBox ID="chk_組合員企業" runat="server" Text="組合員企業の拠点情報があります。" CssClass="enter chk" /></div>
        </ContentTemplate>
        </asp:UpdatePanel>
          <div class="Header3">
            ※入力が完了したら、確認ボタンを押してください。         
        </div>
        <div style="margin-left:280px;margin-top:10px;margin-bottom:40px;">
            <asp:Button ID="btn確認" runat="server" Text="確認" CssClass="btn" OnClick="btn確認_Click" OnClientClick="javascript:focusToControlErr();" />&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnリセット" runat="server" Text="リセット" CssClass="btn" 
                CausesValidation="False" onclick="btnリセット_Click" OnClientClick="return confirm('リセットをしてもよろしいでしょうか？')"/>
        </div>
</div>
</asp:Content>

